
<xsl:stylesheet version="2.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:java="java" 
	>
	<xsl:output omit-xml-declaration="yes" method="xml"/>
	<xsl:variable name="rb" select="java:util.ResourceBundle.getBundle('bundle')"/>
    <xsl:variable name="joomlaHost" >
    	<xsl:value-of select="java:getString($rb,'JOOMLA_HOST')"/>
    </xsl:variable>
	<xsl:variable name="joomlaFileFolder" >
		<xsl:value-of select="java:getString($rb,'JOOMLA_STD_FOLDER')"/>
	</xsl:variable>
	<xsl:variable name="uploadCVTooltip">
		<xsl:value-of select="java:getString($rb,'CANDIDACY_LOAD_CV')"/>
	</xsl:variable>
	<xsl:variable name="downloadCVTooltip">
		<xsl:value-of select="java:getString($rb,'CANDIDACY_DOWNLOAD_CV')"/>
	</xsl:variable>
	<xsl:variable name="swichPanelTooltip">
		<xsl:value-of select="java:getString($rb,'PANEL_SHOW_PANEL')"/>/<xsl:value-of select="java:getString($rb,'PANEL_HIDE_PANEL')"/>
	</xsl:variable>
	<xsl:variable name="idValue" >{ID}</xsl:variable>
	<xsl:template match="/Candidati/Candidato">
		
	<div id="boxDiv">
		
		<h1><xsl:value-of select="java:getString($rb,'CANDIDACY_NEW')"/></h1>				
		<table id="boxTable">
				<tr>
					<th scope="col" class="icon"></th>
					<th scope="col" class="icon"></th>
					<th scope="col" class="icon"></th>
				</tr>
				<tr>
					<td>
						<div id="showPanelBox">
							<h2 id="showPanelBox_label">
								<xsl:value-of select="java:getString($rb,'PANEL_SHOW_PANEL')"/>
							</h2>
							<h2 id="hidePanelBox_label" style="display:none;">
								<xsl:value-of select="java:getString($rb,'PANEL_HIDE_PANEL')"/>
							</h2>
							<xsl:choose>
							    <xsl:when test="ID!='null' and CV!=''">
									<a 	href="javascript:handlePanel('gestioneCandidato.load','panel_target','{ID}','GestioneCandidato');"
										title="{$swichPanelTooltip}"
									>
										<img class="img" src="./img/control-panel-image.jpg" />
									</a>
							
									<p>
										<xsl:value-of select="java:getString($rb,'PANEL_BOX_TEXT1')"/> 
									</p>
							    </xsl:when>
							    <xsl:otherwise>
									<img class="img" src="./img/alert-red-image.jpg" />
									<p style="font-size:90%">
										<b>
											<xsl:value-of select="java:getString($rb,'PANEL_BOX_TEXT2')"/>
										</b>						
									</p>
							    </xsl:otherwise>
							</xsl:choose>
						</div>
					</td>
					<td>
						<div id="uploadCVBox">
							<h2><xsl:value-of select="java:getString($rb,'UPLOAD_TITLE')"/></h2>
							<a 	href="Javascript:target_popup('upload_form')"
								title="{$uploadCVTooltip}"
							>
								<img class="img" src="./img/upload-image.jpg" />
							</a>
							<input type='hidden' name='cv' id='cv' class='user_input' size='20' 
								value='{CV}' />
							<p>
								<xsl:value-of select="java:getString($rb,'UPLOAD_CV_BOX_TEXT1')"/>
							</p>
							<p id="cvPath">
								<b>
									<xsl:value-of select="$joomlaHost"/>
									<xsl:value-of select="$joomlaFileFolder"/>
									<xsl:for-each select="Skills/*">
									  	<xsl:if test="self::node()/@selected='true'">
									  		<xsl:value-of select="name()"/>
									  	</xsl:if>
								 	</xsl:for-each>
								</b>
							</p>
							<p>
								<xsl:value-of select="java:getString($rb,'UPLOAD_CV_BOX_TEXT2')"/>
							</p>
						</div>
					</td>
					<td>
						<div id="showCVBox">
							<h2><xsl:value-of select="java:getString($rb,'DOWNLOAD_CV')"/></h2>
							
							<xsl:choose>
							    <xsl:when test="ID!='null' and CV!=''">
									<a 	href="{$joomlaHost}{CV}" id="cv_link" 
										target="_new" title="{$downloadCVTooltip}"
									>
										<img class="img" src="./img/download-image.jpg" />
									</a>
									<p>
										<xsl:value-of select="java:getString($rb,'DOWNLOAD_CV_BOX_TEXT1')"/>
									</p>
									<p>
										<xsl:value-of select="java:getString($rb,'DOWNLOAD_CV_BOX_TEXT2')"/>
									</p>
							    </xsl:when>
							    <xsl:otherwise>
									<img class="img" src="./img/alert-red-image.jpg" />
									<p style="font-size:90%">
										<b>
											<xsl:value-of select="java:getString($rb,'DOWNLOAD_CV_BOX_TEXT3')"/>
										</b>						
									</p>
							    </xsl:otherwise>
							</xsl:choose>
						</div>
					</td>
				</tr>
			</table>
		
		<div id="panel_target" >
					<xsl:text> </xsl:text>		
		</div>
		<table id="formTable">
				<tr>
				
					<th scope="col" ></th>
					<th scope="col" ></th>
					<th scope="col" ></th>
					<th scope="col" ></th>
					
					<th scope="col" ></th>
					<th scope="col" ></th>
					
					
				</tr>
				
				<tr>
					<td>
						<label for='name' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_NAME')"/>:
						</label>
					</td>
					<td>
						<input 	type='text' name='name' id='name' class='user_input' size='20' 
								value='{Name}'
						/>
					</td>	
					<td>
						<label for='cognome' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_COGNOME')"/>:
						</label>
					</td>	
					<td>
						<input 	type='text' name='cognome' id='cognome' class='user_input' size='20'
								value='{Cognome}'
						/>
					</td>
					<td>
						<label for='dataNascita' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_BIRTHDATE')"/>:
						</label>
					</td>
					<td>
						<input 	type='text' name='dataNascita' id='dataNascita' class='user_input' size='20'
								value='{DataNascita}' 
						/>
					</td>
					
				</tr>
				<tr>
					<td>
						<label for='indirizzo_res' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_INDIRIZZO_RES')"/>:
						</label>
					</td>
					<td>
						<input 	type='text' name='indirizzo_res' id='indirizzo_res' class='user_input' size='20'
								value='{Residenza}'
						/>
					</td>
					<td>
						<label for='cittaRes' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_CITTARES')"/>:
						</label>
					</td>
					<td>
						<input 	type='text' name='cittaRes' id='cittaRes' class='user_input' 
								value='{CittaRes}'
						/>
					</td>
					<td>
						<label for='indirizzoDom' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_INDIRIZZO_DOM')"/>:
						</label>
					</td>
					<td>
						<input 	type='text' name='indirizzoDom' id='indirizzoDom' class='user_input' 
								value='{Domicilio}'
						/>
					</td>
					
				</tr>
				<tr>
					<td>
						<label for='cittaDom' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_CITTADOM')"/>:
						</label>
					</td>
					<td>
						<input type='text' name='cittaDom' id='cittaDom' class='user_input' 
								value='{CittaDom}'
						/>
					</td>
					<td>
						<label for='email' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_EMAIL')"/>:
						</label>
					</td>
					<td>
						<input 	type='text' name='email' id='email' class='user_input' size='20'
								value='{Email}'
						/>
					</td>
					<td>
						<label for='telefono' class='user_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_TELEFONO')"/>:
						</label>
					</td>
					<td>
						<input 	type='text' name='telefono' id='telefono' class='user_input' size='20'
								value='{Telefono}'
						/>
					</td>
				</tr>
				<tr>
					<td>
						
					</td>
					<td>
						
					</td>
				</tr>
			</table>
			<div id='form_altData'>
			
			
					<div id="select_skill_div" class="check_wrapper">
						<label for='select_skill' class='user_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_SKILL')"/>:
						</label>
						<select name="select_skill" id='select_skill' class='user_input'  onChange="javascript:setHiddenField('skill',this.value)">
									<option>
										<xsl:attribute name="value">
										    
										</xsl:attribute>
									</option>
									 <xsl:for-each select="Skills/*">
										 <option>
											  <xsl:attribute name="value">
											    <xsl:value-of select="name()"/>
											  </xsl:attribute>
											  
											  <xsl:if test="self::node()/@selected='true'">
											  	<xsl:attribute name="selected" >
											    	selected
											  	</xsl:attribute>
											  </xsl:if>
											  
											  <xsl:value-of select="self::node()[text()]"/>
										 </option>
									 </xsl:for-each>
								</select>					
								<input type='hidden' name='skill' id='skill' class='user_input' size='25' />
					</div>
				
					<div id="select_contratto_div" class="check_wrapper">
						<label for='select_contratto' class='user_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_CONTRATTO')"/>:
						</label>
						<select name="select_contratto" id='select_contratto' class='user_input'  onChange="javascript:setHiddenField('contratto',this.value)">
									<option>
										<xsl:attribute name="value">
										    
										</xsl:attribute>
									</option>
									 <xsl:for-each select="Contratto/*">
										 <option>
											  <xsl:attribute name="value">
											    <xsl:value-of select="name()"/>
											  </xsl:attribute>
											  
											  <xsl:if test="self::node()/@selected='true'">
											  	<xsl:attribute name="selected" >
											    	selected
											  	</xsl:attribute>
											  </xsl:if>
											  
											  <xsl:value-of select="self::node()[text()]"/>
										 </option>
									 </xsl:for-each>
								</select>					
								<input type='hidden' name='contratto' id='contratto' class='user_input' size='25' />
					</div>
				
				
					<div id='ambiente_sviluppo_div' class="check_wrapper">
						<span class='wrapper_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_AMBIENTE_SVIL')"/>:
						</span>
						<div style="">
							<xsl:for-each select="AmbienteSviluppo/*">
									<label class="check_label">
										<input type="checkbox" class="check_input" name="ambientiSvil" >
											<xsl:attribute name="value">
											    <xsl:value-of select="name()"/>
											</xsl:attribute>
											  
											<xsl:if test="self::node()/@selected='true'">
												<xsl:attribute name="checked" >
											    	checked
											  	</xsl:attribute>
											</xsl:if>
										</input>
										<span class='check_label'><xsl:value-of select="self::node()[text()]"/></span>
									</label>
							</xsl:for-each>	
						</div>
					</div>	
					<div id='sistemi_operativi_div' class="check_wrapper">
						<span class='wrapper_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_SISTEMI_OPERATIVI')"/>:
						</span>
						<div style="float:right;position:relative;left:-191px;">
							<xsl:for-each select="SistemiOperativi/*">
									<label class="check_label">
										<input type="checkbox" class="check_input" name="sistemiOperativi" >
											<xsl:attribute name="value">
											    <xsl:value-of select="name()"/>
											</xsl:attribute>
											  
											<xsl:if test="self::node()/@selected='true'">
												<xsl:attribute name="checked" >
											    	checked
											  	</xsl:attribute>
											</xsl:if>
										</input>
										<span class='check_label'><xsl:value-of select="self::node()[text()]"/></span>
									</label>
							</xsl:for-each>	
						</div>
					</div>	
					
					<div id='db_div' class="check_wrapper">
						<span class='wrapper_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_DB')"/>:
						</span>
						<div style="float:right;position:relative;left:-208px;">
							<xsl:for-each select="DB/*">
									<label class="check_label">
										<input type="checkbox" class="check_input" name="db" >
											<xsl:attribute name="value">
											    <xsl:value-of select="name()"/>
											</xsl:attribute>
											  
											<xsl:if test="self::node()/@selected='true'">
												<xsl:attribute name="checked" >
											    	checked
											  	</xsl:attribute>
											</xsl:if>
										</input>
										<span class='check_label'><xsl:value-of select="self::node()[text()]"/></span>
									</label>
							</xsl:for-each>	
						</div>
					</div>	
					
					<div id='application_server_div' class="check_wrapper">
						<span class='wrapper_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_APPLICATION_SERVER')"/>:
						</span>
						<div style="float:right;position:relative;left:-198px;">
							<xsl:for-each select="ApplicationServer/*">
									<label class="check_label">
										<input type="checkbox" class="check_input" name="appServer" >
											<xsl:attribute name="value">
											    <xsl:value-of select="name()"/>
											</xsl:attribute>
											  
											<xsl:if test="self::node()/@selected='true'">
												<xsl:attribute name="checked" >
											    	checked
											  	</xsl:attribute>
											</xsl:if>
										</input>
										<span class='check_label'><xsl:value-of select="self::node()[text()]"/></span>
									</label>
							</xsl:for-each>	
						</div>
					</div>	
					<div id='prodotti_div' class="check_wrapper">
						<span class='wrapper_label'>
							<xsl:value-of select="java:getString($rb,'CANDIDACY_PRODOTTI')"/>:
						</span>
						<div style="float:right;position:relative;left:-16px;">
							<xsl:for-each select="Prodotti/*">
									<label class="check_label">
										<input type="checkbox" class="check_input" name="prodotti" >
											<xsl:attribute name="value">
											    <xsl:value-of select="name()"/>
											</xsl:attribute>
											  
											<xsl:if test="self::node()/@selected='true'">
												<xsl:attribute name="checked" >
											    	checked
											  	</xsl:attribute>
											</xsl:if>
										</input>
										<span class='check_label'><xsl:value-of select="self::node()[text()]"/></span>
									</label>
							</xsl:for-each>	
						</div>
					</div>
					<div id='patente_div' class="check_wrapper">
						<label for='select_patente' class='user_label'><xsl:value-of select="java:getString($rb,'CANDIDACY_PATENTE')"/>:</label>
						<select name="select_patente" id='select_patente' class='user_input'  onChange="javascript:setHiddenField('patente',this.value)">
							<option>
								<xsl:attribute name="value">
								    
								</xsl:attribute>
							</option>
							<xsl:for-each select="Patente/*">
								<option>
									  <xsl:attribute name="value">
									    <xsl:value-of select="name()"/>
									  </xsl:attribute>
									  
									  <xsl:if test="self::node()/@selected='true'">
									  	<xsl:attribute name="selected" >
									    	selected
									  	</xsl:attribute>
									  </xsl:if>
									  
									  <xsl:value-of select="self::node()[text()]"/>
								 </option>
							 </xsl:for-each>
						</select>					
						<input type='hidden' name='patente' id='patente' class='user_input' size='25' />
					</div>	
					<div id="comeCiHaiConosciuto_div" class="check_wrapper">
							<label for='select_comeCiHaiConosciuto' class='user_label'><xsl:value-of select="java:getString($rb,'CANDIDACY_COME_CI_HAI_CONOSCIUTO')"/>:</label>
							<select name="select_comeCiHaiConosciuto" id='select_comeCiHaiConosciuto' class='user_input'  onChange="javascript:setHiddenField('comeCiHaiConosciuto',this.value)">
							<option>
								<xsl:attribute name="value">
								    
								</xsl:attribute>
							</option>
							 <xsl:for-each select="ComeCiHaiConosciuto/*">
								 <option>
									  <xsl:attribute name="value">
									    <xsl:value-of select="name()"/>
									  </xsl:attribute>
									  
									  <xsl:if test="self::node()/@selected='true'">
									  	<xsl:attribute name="selected" >
									    	selected
									  	</xsl:attribute>
									  </xsl:if>
									  
									  <xsl:value-of select="self::node()[text()]"/>
								 </option>
							 </xsl:for-each>
						</select>					
						<input type='hidden' name='comeCiHaiConosciuto' id='comeCiHaiConosciuto' class='user_input' size='25' />
					</div>
				</div>
				<div class="check_wrapper">
					<a href="javascript:getTarget('candidato.save','target','{ID}','Candidato')" id="save_button" >Salva</a>
				</div>
					

			
			
			
	</div>
	
	</xsl:template>
</xsl:stylesheet>